/*
Copyright © 2025 ESO Maintainer Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package template

import (
	"testing"

	gopkcs12 "software.sslmate.com/src/go-pkcs12"
)

const (
	expectedPfx    string = "MIIKAQIBAzCCCbEGCSqGSIb3DQEHAaCCCaIEggmeMIIJmjCCBAgGCSqGSIb3DQEHBqCCA/kwggP1AgEAMIID7gYJKoZIhvcNAQcBMF0GCSqGSIb3DQEFDTBQMC8GCSqGSIb3DQEFDDAiBBAiMDEyMzQ1Njc4OSIAAAAAAgIIADAKBggqhkiG9w0CCTAdBglghkgBZQMEASoEECIwMTIzNDU2Nzg5IgAAAACAggOA3PfruBHwXSLGGGcI6woqtR/A8eBKsYZt0r6kpLf9w3aC9Idic93fY4lPhf2v3d/tin7CZwboeiT6H4uM5s+TrYWWbZIcHh67femCfMjbwnNSkOuzZOFmprJUUEtdZhP8ifDh0NcqT//0KmwRIYaV4JPxmGFfblRFSaLg0daKfCFKIE7onJMa/uy0i4IREzserCNNSZezCNOdtSfWdvjKrIlCFGopjv6iO1oG1qT6JN7YWDZNzgDposmtkIqwP+tNn+40iyv56uVMXZPJHxWxQMhvo24Iq7Qtni+TE+rLmHbiC2l8/99m03YzqDRfA2iDtptqk+rmVf7bVm0nzPEUoWVC0LqQj4RDA/x5mi29OIlOYCfYNi8OJm4wlFlc49USg0URhz6fihNZdp3tcl/In2BKPyAPeLSE5DQb94WWSTlsRov1dw+G6bGD3ClsNZ8xfoBarr93auk1HP1Y3uDzvTAXjBHhMvKamm8pTn2b97qDqWvQDSk+39hh/Ey1hPqr8tdsqCZCpLrvvty9hmtREaosD5/1lNtoZ3AjdhCDlhWshMhh7HFDHTK9nV7xDpETX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BXP3RlnLNQmmGN/2fpbb0uDq936eOt+u+iC4SgpGYuDpvca+b+MGTe8LlgPgmNCN6lGvl30DBje0bLWVHs+Gb5tNQjIkbMCed8dOidmeMT00Hgq1lHqvVSQDOU0jvwpNsr4/5Lpe71Rx269LyHeBM76T/JL9dFosvriI+4iUlJKoSQvIl6nu1CI+D4HLa6V+twGHyT6+yS1zhun3ttVaamjzQYx7Bu/OmY55MfwMMjeToUjXB4/ohdvfb5qa38Aewnb1TBHMC8wCwYJYIZIAWUDBAIBBCDt710mIM4Nlpru7X7gbfRhw+mfK39QcGwbs6IkesPvvAQQIjAxMjM0NTY3ODkiAAAAAAICCAA="
)

func TestPemToPkcs12(t *testing.T) {
	// Mock the random generator, to guarantee to always generate the same output
	gopkcs12.Modern = gopkcs12.Modern.WithRand(MockRandomReader{})

	out, err := pemToPkcs12Pass(certData, keyData, "password")
	if err != nil {
		t.Errorf("pemToPkcs12Pass() got error '%v', expected none", err)
		return
	}

	if out != expectedPfx {
		t.Errorf("pemToPkcs12Pass() got '%s', expected '%s'", out, expectedPfx)
	}
}

func TestFullPemToPkcs12(t *testing.T) {
	// Mock the random generator, to guarantee to always generate the same output
	gopkcs12.Modern = gopkcs12.Modern.WithRand(MockRandomReader{})

	out, err := fullPemToPkcs12Pass(certData+"\n"+otherCert, keyData, "password")
	if err != nil {
		t.Errorf("pemToPkcs12Pass() got error '%v', expected none", err)
		return
	}

	if out != expectedPfxCa {
		t.Errorf("pemToPkcs12Pass() got '%s', expected '%s'", out, expectedPfxCa)
	}
}

func TestPemTruststoreToPKCS12(t *testing.T) {
	// Mock the random generator, to guarantee to always generate the same output
	gopkcs12.Modern = gopkcs12.Modern.WithRand(MockRandomReader{})

	out, err := pemTruststoreToPKCS12Pass(certData+"\n"+otherCert, "password")
	if err != nil {
		t.Errorf("pemTruststoreToPKCS12Pass() got error '%v', expected none", err)
		return
	}

	if out != expectedPfxCAs {
		t.Errorf("pemTruststoreToPKCS12Pass() got '%s', expected '%s'", out, expectedPfxCAs)
	}
}

type MockRandomReader struct{}

func (r MockRandomReader) Read(p []byte) (int, error) {
	copy(p, `"0123456789"`)
	return len(p), nil
}
